<%@ Page Title="Management Image" Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="ImageManagement.aspx.cs" Inherits="Admin_ImageManagement" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" Runat="Server">
    <script type="text/javascript">
        function OpenPositionedWindow(oButton, url, windowName) {
            var oWnd = window.radopen(url, windowName);
        }
        function openRadWindow(RestID) {
            var oWnd = radopen("UploadImage.aspx?RestID=" + RestID, "RadWindow1");
            oWnd.setSize(800, 450);
            oWnd.center();
        }
    </script>
    <div>
        <telerik:RadGrid ID="uxImage" runat="server" AutoGenerateColumns="false" 
            AllowPaging="true" AllowSorting="true" ShowStatusBar="true"
            Skin="Web20" PagerStyle-Mode="NextPrevNumericAndAdvanced" PageSize="30" 
            onneeddatasource="uxImage_NeedDataSource">
            <MasterTableView DataKeyNames="RestID">
                <Columns>
                    <telerik:GridTemplateColumn>
                        <ItemTemplate>
                            <a href="#" style="color:Blue" onclick="openRadWindow('<%#DataBinder.Eval(Container.DataItem,"RestID")%>'); return false;">
                            Upload</a>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn Visible="false" HeaderText="RestID" UniqueName="RestID"
                        DataField="RestID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="RestName" UniqueName="RestName" DataField="RestName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="ImageFolderName" UniqueName="ImageFolderName" DataField="ImageFolderName">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"
            Width="75px">
            <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading1.gif") %>'
                style="border: 0px; margin-top:300px" />
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        </telerik:RadWindowManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="uxImage">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="uxImage" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
    </div>
</asp:Content>